import request from '@/utils/request'

// 查询退货单信息列表
export function listOrders(query) {
  if(query.refund=="null")query.refund=null;
  if(query.status=="null")query.status=null;
  return request({
    url: '/system/orders/list',
    method: 'get',
    params: query
  })
}

// 查询退货单信息详细
export function getOrders(returnedOrdersId) {
  return request({
    url: '/system/orders/' + returnedOrdersId,
    method: 'get'
  })
}

// 新增退货单信息
export function addOrders(data) {
  return request({
    url: '/system/orders',
    method: 'post',
    data: data
  })
}

// 通过退货单信息
export function updateOrders(data) {
  return request({
    url: '/system/orders',
    method: 'put',
    data: data
  })
}

// 删除退货单信息
export function delOrders(returnedOrdersId) {
  return request({
    url: '/system/orders/' + returnedOrdersId,
    method: 'delete'
  })
}
